//package com.sprucetec.common.config;
//
//import com.sprucetec.commons.registry.RegistryProxy;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.core.env.Environment;
//
//public class ScheduleConfig {
//
//    /**
//     * 多任务实例定时任务注册地址
//     */
//    @Value("${schedule.config.zookeeper}")
//    private String DUBBO_ADDRESS;
//
//    @Autowired
//    private Environment environment;
//
//    /**
//     * 判断是否在指定的时间进行会议签到，调用接口定时任务Leader标识
//     */
//    private String MEETING_SIGN_SCHEDULE;
//
//    /**
//     * 判断是否在指定的时间进行会议签到，调用接口定时更新时间配置
//     */
//    @Value("${schedule.config.cron.meeting.sign}")
//    private String MEETING_SIGN_SCHEDULE_CRON;
//
//    /**
//     * 定时任务注册地址初始化
//     *
//     * @return
//     */
//    @Bean(initMethod = "open", destroyMethod = "close")
//    public RegistryProxy registryProxy() {
//        return new RegistryProxy(DUBBO_ADDRESS);
//    }
//
//    @Autowired
//    RegistryProxy registryProxy;
//
//    /**
//     * 判断是否在指定的时间进行会议签到
//     *
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public MeetingSignJob meetingSignJob() {
//        MeetingSignJob job = new MeetingSignJob();
//        job.setCron(MEETING_SIGN_SCHEDULE_CRON);
//        job.setRegistry(registryProxy);
//        job.setLeaderPath(MEETING_SIGN_SCHEDULE);
//        return job;
//    }
//
//    /**
//     * 释放锁定未预定的会议室
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public FreeMeetingLockJob freeMeetingLockJob() {
//        FreeMeetingLockJob job = new FreeMeetingLockJob();
//        job.setCron(environment.getProperty("schedule.config.cron.meeting.lock"));
//        job.setRegistry(registryProxy);
//        job.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.lock"));
//        return job;
//    }
//
//    /**
//     * 发送钉钉通知消息提醒
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public SendMsgJob sendMsgJob() {
//        SendMsgJob sendMsgJob = new SendMsgJob();
//        sendMsgJob.setCron(environment.getProperty("schedule.config.cron.meeting.notify"));
//        sendMsgJob.setRegistry(registryProxy);
//        sendMsgJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.notify"));
//        return sendMsgJob;
//    }
//
//    /**
//     * 处理会议预约
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public HandleMeetingSubscribeJob handleMeetingSubscribeJob() {
//        HandleMeetingSubscribeJob handleMeetingSubscribeJob = new HandleMeetingSubscribeJob();
//        handleMeetingSubscribeJob.setCron(environment.getProperty("schedule.config.cron.meeting.handleSubscribe"));
//        handleMeetingSubscribeJob.setRegistry(registryProxy);
//        handleMeetingSubscribeJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.handleSubscribe"));
//        return handleMeetingSubscribeJob;
//    }
//
//    /**
//     * 会议预约过期cron
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public MeetingSubscribeExceedJob meetingSubscribeExceedJob() {
//        MeetingSubscribeExceedJob meetingSubscribeExceedJob = new MeetingSubscribeExceedJob();
//        meetingSubscribeExceedJob.setCron(environment.getProperty("schedule.config.cron.meeting.subscribeExceed"));
//        meetingSubscribeExceedJob.setRegistry(registryProxy);
//        meetingSubscribeExceedJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.subscribeExceed"));
//        return meetingSubscribeExceedJob;
//    }
//
//    /**
//     * 删除已过期的视频会议室
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public DeleteExceedRoomJob deleteExceedRoomJob() {
//        DeleteExceedRoomJob deleteExceedRoomJob = new DeleteExceedRoomJob();
//        deleteExceedRoomJob.setCron(environment.getProperty("schedule.config.cron.meeting.deleteExceedRoom"));
//        deleteExceedRoomJob.setRegistry(registryProxy);
//        deleteExceedRoomJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.deleteExceedRoom"));
//        return deleteExceedRoomJob;
//    }
//
//    /**
//     * 创建参会账号
//     * @return
//     */
///*  @Bean(initMethod = "start", destroyMethod = "stop")
//  public CreateZoomUserJob createZoomUserJob() {
//    CreateZoomUserJob createZoomUserJob = new CreateZoomUserJob();
//    createZoomUserJob.setCron(environment.getProperty("schedule.config.cron.meeting.createZoomUserJob"));
//    createZoomUserJob.setRegistry(registryProxy);
//    createZoomUserJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.createZoomUserJob"));
//    return createZoomUserJob;
//  }*/
//
//    /**
//     * count 视频会议室参会人员情况
//     * @return
//     */
//    @Bean(initMethod = "start", destroyMethod = "stop")
//    public GetVideoUserMegJob getVideoUserMegJob() {
//        GetVideoUserMegJob getVideoUserMegJob = new GetVideoUserMegJob();
//        getVideoUserMegJob.setCron(environment.getProperty("schedule.config.cron.meeting.queryDeptAndUser"));
//        getVideoUserMegJob.setRegistry(registryProxy);
//        getVideoUserMegJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.queryDeptAndUser"));
//        return getVideoUserMegJob;
//    }
//    /**
//     * count zoom视频会议室端口占用数
//     * @return
//     */
////  @Bean(initMethod = "start", destroyMethod = "stop")
////  public MeetingVideoUserCountJob countVideoUserNumJob() {
////    MeetingVideoUserCountJob countVideoUserNumJob = new MeetingVideoUserCountJob();
////    countVideoUserNumJob.setCron(environment.getProperty("schedule.config.cron.meeting.countVideoUserNum"));
////    countVideoUserNumJob.setRegistry(registryProxy);
////    countVideoUserNumJob.setLeaderPath(environment.getProperty("schedule.config.leader.meeting.countVideoUserNum"));
////    return countVideoUserNumJob;
////  }
//
//}